home *** CD-ROM | disk | FTP | other *** search
- property currentSoundLevel, placeHolderCast, totalMemory, theBrainCastNumList
- global usersColorDepth, leftPanelSpr, soundStatusFieldSpr, loopStatusFieldSpr, listMgr, fileMgr, dirtyFlag, PCflag
-
- on birth me
- set currentSoundLevel to 3
- set the volume of sound 1 to 32 * currentSoundLevel
- set the volume of sound 2 to 32 * currentSoundLevel
- set theBrainCastNumList to [151, 152, 153, 154, 155, 156, 157, 158, 159, 160]
- formatTextFields(me)
- initializeTextFields(me)
- set placeHolderCast to the number of cast "placeholder cast"
- set totalMemory to the freeBytes
- return me
- end
-
- on newCartoon me
- if dirtyFlag then
- set theMessage to "Do you want to save your changes before starting a new cartoon?"
- set theAlertBoxType to #dontsave_cancel_save
- showTheAlertBox(theMessage, theAlertBoxType, "reset(appMgr)", "nothing", "doSaveThenNextAction(fileMgr, #new)")
- else
- set theMessage to "Are you sure you want to start a new cartoon?"
- set theAlertBoxType to #cancel_ok
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "reset(appMgr)")
- end if
- end
-
- on quitToolbox me
- if dirtyFlag then
- set theMessage to "Do you want to save your changes before quitting?"
- set theAlertBoxType to #dontsave_cancel_save
- showTheAlertBox(theMessage, theAlertBoxType, "justQuit(appMgr)", "nothing", "doSaveThenNextAction(fileMgr, #quit)")
- else
- set theMessage to "Are you sure you want to quit?"
- set theAlertBoxType to #cancel_ok
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "justQuit(appMgr)")
- end if
- end
-
- on justQUit
- repeat with i = 2 to 16
- set the locH of sprite i to -1000
- end repeat
- repeat with i = 36 to 48
- set the locH of sprite i to -1000
- end repeat
- updateStage()
- startTimer()
- set the castNum of sprite 1 to the number of cast "credits1"
- set the loc of sprite 1 to point(313, 218)
- updateStage()
- repeat while (the timer < 7200) and the mouseUp
- end repeat
- if PCflag then
- repeat with i = 1 to 48
- set the locH of sprite i to -1000
- end repeat
- updateStage()
- repeat with i = 1 to 48
- puppetSprite(i, 0)
- end repeat
- go("PCQUIT")
- else
- set the colorDepth to usersColorDepth
- startTimer()
- quit()
- end if
- end
-
- on showCredits me
- set songNumber to random(the number of lines in field "LOOdata")
- set songRecord to value(line songNumber of field "LOOdata")
- set theSongCastNum to getAt(songRecord, 3)
- puppetSound(2, theSongCastNum)
- set oldBgd to the castNum of sprite 1
- set oldLocOfSpr1 to the loc of sprite 1
- set oldLocHofSpr2 to the locH of sprite 2
- set oldLocHofSpr16 to the locH of sprite 16
- set the locH of sprite 2 to -1000
- set the locH of sprite 16 to -1000
- repeat with theSprite = 3 to 14
- set the blend of sprite theSprite to 30
- end repeat
- startTimer()
- set the castNum of sprite 1 to the number of cast "credits1"
- set the loc of sprite 1 to point(313, 218)
- updateStage()
- puppetTransition(51)
- repeat while (the timer < 600) and the mouseUp
- if not soundBusy(2) then
- puppetSound(2, theSongCastNum)
- end if
- end repeat
- startTimer()
- set the castNum of sprite 1 to the number of cast "credits2"
- set the loc of sprite 1 to point(313, 218)
- updateStage()
- puppetTransition(51)
- repeat while (the timer < 600) and the mouseUp
- if not soundBusy(2) then
- puppetSound(2, theSongCastNum)
- end if
- end repeat
- startTimer()
- set the castNum of sprite 1 to the number of cast "credits3"
- set the loc of sprite 1 to point(313, 218)
- updateStage()
- puppetTransition(51)
- repeat while (the timer < 600) and the mouseUp
- if not soundBusy(2) then
- puppetSound(2, theSongCastNum)
- end if
- end repeat
- startTimer()
- set the castNum of sprite 1 to the number of cast "credits4"
- set the loc of sprite 1 to point(313, 218)
- updateStage()
- puppetTransition(51)
- repeat while (the timer < 600) and the mouseUp
- if not soundBusy(2) then
- puppetSound(2, theSongCastNum)
- end if
- end repeat
- startTimer()
- set the castNum of sprite 1 to the number of cast "credits5"
- set the loc of sprite 1 to point(313, 218)
- updateStage()
- puppetTransition(51)
- repeat while (the timer < 600) and the mouseUp
- if not soundBusy(2) then
- puppetSound(2, theSongCastNum)
- end if
- end repeat
- set the locH of sprite 2 to oldLocHofSpr2
- set the locH of sprite 16 to oldLocHofSpr16
- repeat with theSprite = 3 to 14
- set the blend of sprite theSprite to 100
- end repeat
- set the castNum of sprite 1 to oldBgd
- set the loc of sprite 1 to oldLocOfSpr1
- set oldVolume to the volume of sound 2
- repeat while the volume of sound 2 > 0
- startTimer()
- set the volume of sound 2 to the volume of sound 2 - 8
- repeat while the timer < 6
- end repeat
- end repeat
- puppetSound(2, 0)
- set the volume of sound 2 to oldVolume
- updateStage()
- end
-
- on reset me
- cursor(4)
- repeat with i = 2 to 14
- set the castNum of sprite i to placeHolderCast
- set the locH of sprite i to -1000
- end repeat
- set the castNum of sprite 16 to placeHolderCast
- set the locH of sprite 16 to -1000
- clearToonDataFileName(fileMgr)
- setCurrentCartoonName(fileMgr, "Untitled")
- setCurrentCartoonCredits(fileMgr, EMPTY)
- resetKrusty(playbackMgr)
- clear(layerMgr)
- reset(listMgr)
- update(stackMgr)
- initializeTextFields(me)
- unLoadCast()
- updateTheBrain(me)
- cursor(-1)
- set dirtyFlag to 0
- updateStage()
- end
-
- on updateFileNameField me
- set the text of field "fileNameField" to getCurrentCartoonName(fileMgr)
- end
-
- on checkMemory me
- if the optionDown then
- clearMemory(me)
- else
- set the text of field "fileNameField" to the freeBytes / 1024 & "K free"
- cursor(-1)
- repeat while the mouseUp
- end repeat
- updateFileNameField(me)
- end if
- end
-
- on clearMemory me
- unLoadCast()
- set the text of field "fileNameField" to "clearing memory…"
- updateStage()
- updateFileNameField(me)
- updateTheBrain(me)
- end
-
- on updateTheBrain me
- set usedMemory to totalMemory - the freeBytes
- set percentageFull to integer(usedMemory * 100 / totalMemory)
- set percentageFull to percentageFull / 10
- if percentageFull > 0 then
- set oldPanel to the castNum of sprite leftPanelSpr
- set newPanel to getAt(theBrainCastNumList, percentageFull)
- if newPanel <> oldPanel then
- set the castNum of sprite leftPanelSpr to newPanel
- unLoadCast(oldPanel)
- end if
- else
- set oldPanel to the castNum of sprite leftPanelSpr
- set newPanel to the number of cast "left panel base"
- if newPanel <> oldPanel then
- set the castNum of sprite leftPanelSpr to newPanel
- unLoadCast(oldPanel)
- end if
- end if
- end
-
- on changeVolume me, volumePosition
- set currentSoundLevel to volumePosition
- set the volume of sound 1 to 32 * currentSoundLevel
- set the volume of sound 2 to 32 * currentSoundLevel
- end
-
- on getCurrentSoundLevel me
- return currentSoundLevel
- end
-
- on formatTextFields me
- if PCflag then
- set the textFont of field "filenamefield" to "Arial"
- set the textSize of field "filenamefield" to 10
- set the textStyle of field "filenamefield" to "bold"
- set the textFont of cast "loopstatusfield" to "Arial"
- set the textSize of cast "loopstatusfield" to 9
- set the textStyle of cast "loopstatusfield" to "plain"
- set the textFont of cast "soundstatusfield" to "Arial"
- set the textSize of cast "soundstatusfield" to 9
- set the textStyle of cast "soundstatusfield" to "plain"
- else
- set the textFont of field "filenamefield" to "Geneva"
- set the textSize of field "filenamefield" to 10
- set the textStyle of field "filenamefield" to "bold"
- set the textFont of cast "loopstatusfield" to "Geneva"
- set the textSize of cast "loopstatusfield" to 9
- set the textStyle of cast "loopstatusfield" to "plain"
- set the textFont of cast "soundstatusfield" to "Geneva"
- set the textSize of cast "soundstatusfield" to 9
- set the textStyle of cast "soundstatusfield" to "plain"
- end if
- end
-
- on initializeTextFields me
- set the text of field "fileNameField" to "Untitled"
- set the text of field "loopstatusfield" to EMPTY
- set the text of field "soundstatusfield" to EMPTY
- set the loc of sprite loopStatusFieldSpr to point(147, 403)
- set the loc of sprite soundStatusFieldSpr to point(391, 403)
- updateStage()
- end
-
- on hiliteSoundFXField me
- set the foreColor of cast "soundStatusField" to 39
- set the backColor of cast "soundStatusField" to 255
- updateStage()
- end
-
- on hiliteSoundLoopField me
- set the foreColor of cast "loopStatusField" to 39
- set the backColor of cast "loopStatusField" to 255
- updateStage()
- end
-
- on hideFieldHiliterSpr me
- set the foreColor of cast "soundStatusField" to 255
- set the backColor of cast "soundStatusField" to 39
- set the foreColor of cast "loopStatusField" to 255
- set the backColor of cast "loopStatusField" to 39
- updateStage()
- end
-